package com.ssy.lingxi.product.entity.customer;

import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;

/**
 * 属性组实体类--前端客户
 * @author jw.chen
 * @version 2.0.0
 * @date 2020/6/23
 */
@Getter
@Setter
@Entity
@Table(schema = "public", name = "product_customer_attribute_group", indexes = {@Index(name = "product_customer_attribute_group_member_id_member_role_id_idx", columnList = "memberId,memberRoleId")})
public class CustomerAttributeGroup implements Serializable {
    private static final long serialVersionUID = -3448606347609115008L;
    /**
     * 主键id
     */
    @Id
    @GeneratedValue(strategy= GenerationType.SEQUENCE, generator="customer_attribute_group_seq")
    @SequenceGenerator(sequenceName="product_customer_attribute_group_seq", name="customer_attribute_group_seq",allocationSize = 1)
    private Long id;

    /**
     * 属性组名
     */
    @NotEmpty(message = "属性组名不能为空")
    @Column(columnDefinition = "varchar(20)", nullable = false)
    private String name;

    /**
     * 会员id
     */
    @Column(columnDefinition = "int8", nullable = false)
    private Long memberId;

    /**
     * 会员名称
     */
    @Column(columnDefinition = "varchar(50)", nullable = false)
    private String memberName;

    /**
     * 会员角色id
     */
    @Column(columnDefinition = "int8", nullable = false)
    private Long memberRoleId;

    /**
     * 会员角色名称
     */
    @Column(columnDefinition = "varchar(50)", nullable = false)
    private String memberRoleName;

    /**
     * 用户id
     */
    @Column(columnDefinition = "int8", nullable = false)
    private Long userId;

    /**
     * 用户名称
     */
    @Column(columnDefinition = "varchar(50)", nullable = false)
    private String userName;

    /**
     * 创建时间
     */
    @Column(columnDefinition = "int8", nullable = false)
    private Long createTime = System.currentTimeMillis();
}
